package forms

import (
//"gopkg.in/mgo.v2"
//	"gopkg.in/mgo.v2/bson"
	"time"
	"LiquidMeasurement/models"
)




type UserSessionType struct {
	LastDate				time.Time
	Count					int
	VefifyCode				int
	IP						string
	Encryptionkey			string
}
type AdminSessionType struct {
	LastDate				time.Time
	Count					int
	VefifyCode				int
	IsLogin					bool
	Admin					models.Admin
}
type BedSessionType  struct{
	BedID				int64
	Mac					string
	Data			    interface {}
	SurplusCapacity     uint8
	LastDate			time.Time
	Count				int
	VefifyCode			int
	IsLogin				bool
}


//用于网站进行ajax上传数据的返回值
type SiteResponeType struct {
	RespCode				int64
	Msg						string
	Data					interface {}
}



//RespCode
const (
	SUCCESS     		= 0       //操作成功
	OFFLONE    			= 1       //设备不在线
	PARA_ERROR  		= 2       //参数错误
	PARA_JSON_ERROR  	= 3       //参数JSON序列化错误
	OPERATION_ERROR		= 4		//系统操作失败
	OPERATION_CHECK		= 5		//数据转为重查
	INVALID_NAME        = 6     //帐号出错
	INVALID_PW        	= 7     //密码出错
	EXIST_NAME       	= 8     //注册时，该手机号已经被注册
	RES_REGISTER		= 9     //设备未向服务器发起注册，或者设备以掉线，设备重连
	TEL_NULL			= 10    //电话号码为空
	MAX_MSG				= 11    	//该手机号已经超过最大的验证次数
	NOT_TEL				= 12		//效的手机号
	VERIFY_CODE_ERR				= 13		//验证码错误
	NEED_LOGIN			= 14
	NO_NEW_VERSION			= 15
	INVALID     		= 0         //该位无效
	INVALIDS    		= "0"
)
//用于网站的RespCode
const (
	SITE_SUCCESS     		= 200       //操作成功
	SITE_PARA_ERROR  		= 201       //参数错误
	SITE_WRITE_SQL_ERROR  	= 202       //参数JSON序列化错误
	SITE_VERIFY_CODE  	   = 203       //验证码错误
	SITE_PERMISSION_ERR  	   = 204       //验证码错误
	SITE_DELETE_ERR			= 205
	SITE_OPERATION_ERROR	= 206
	SITE_METHOD_ERROR	= 207


)
//var INVALID_CODE_TIME   = CodeTimeType{0,0,[2]int32{0,0},[2]int32{0,0}}
const(
	ONEDAY2SEC			= 86400
	MAX_THRESHOLD		= 2^64
	MAC_PARTICLE_SIZE	= 1440
	DEFAULT_PARTICLE_SIZE	= 10
	DEFAULT_THRESHOLD_SIZE	= 10
	DEFAULT_MASHINE_LEARN	= false
	DEFAULT_MAX_MSG	    int			= 5
	CLIENT_VALID_SECOND		= 600
)